package com.qf.tenant.manager.api;

import com.qf.common.bean.R;
import com.qf.common.dto.ProductDto;
import com.qf.common.model.QfProduct;
import com.qf.tenant.manager.service.ProductService;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 租户产品管理
 * @author 千锋健哥
 */
@RestController
@RequestMapping("/tenant/product")
public class ProductController {

    @Autowired
    private ProductService productService;

    @PostMapping("/add")
    public R<QfProduct> add(@RequestBody ProductDto dto) {
        R<QfProduct> result = productService.add(dto);
        return result;
    }
}
